import request from './axiosRequest'
import useEnv from "@/hooks/useEnv";
const show = useEnv.VITE_FILE_API + "/shows?uuid="

const chechEmail = (email) => {
    return request({
        url: '/identity/checkEmail?email=' + email
    })
}
const registerByEmailAndCode = (data) => {
    return request({
        url: '/identity/registerByEmailAndCode',
        data: data,
        method: 'post'
    })
}

const sendEmail = (email) => {
    return request({
        url: '/identity/sendEmail?email=' + email
    })
}
const loginByEmailAndCode = (data) => {
    return request({
        url: '/identity/loginByEmailAndCode',
        data: data,
        method: 'post'
    })
}

const getMyself = () => {
    return request({
        url: '/user/myself'
    })
}

const loginByEmailAndPassword = (data) => {
    return request({ url: '/identity/login', data: data, method: 'post' })
}



export default {
    registerByEmailAndCode,
    loginByEmailAndCode,
    chechEmail,
    sendEmail,
    getMyself,
    loginByEmailAndPassword,
    show
}